﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;

public partial class Family_TestAddNewBook : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        //string bname = "富饶的西沙群岛";
        //string author = "你我他";
        //string press = "人民教育出版社";
        //decimal price = 22.45M;
        //string isbn = "1234567890123";
        //string pym = "2003-12";
        //int cid = 5;
        //string descript = "西沙历来就是中国的领土！";
        //string pname = "123.jpg";
        //string uid = "3e537cd3-7d86-417c-a732-dd01fcab6e92";
        //string bid = "YS0000000003";
        //int ReturnValue = 0;
        //string ReturnFieldValue = "";
//---------------------------------------------------------------------------------------------------------------------------------------
        //添加新书时执行。
        //b为受影响的行数为1时为真，另外还有一个存储过程返回值，和一个存储过程返回的字段值。
        //bool b=XJX.Page.Book.Add_New_Book(bname, author, press, price, isbn, pym, cid, descript, pname, uid, out ReturnValue, out ReturnFieldValue);
        //if (b)
        //{
        //    msg.Text = "执行成功！";
        //}
        //else
        //{
        //    msg.Text = "执行失败！";
        //}
//---------------------------------------------------------------------------------------------------------------------------------------
        //修改图书信息时执行
        //修改时，若不能修改，则返回值为9
        //bool b = XJX.Page.Book.Modify_One_Book_Info(bname, author, press, price, isbn, pym, cid, descript, pname, uid,bid, out ReturnValue, out ReturnFieldValue);
        //if (b)
        //{
        //    msg.Text = "执行成功！";
        //}
        //else
        //{
        //    if (ReturnValue == 9) { msg.Text = "图书未处于正常借阅状态！"; } else { msg.Text = "其它原因执行失败！"; }
        //}
//---------------------------------------------------------------------------------------------------------------------------------------
        //下架或上架一本书时执行,ReturnFieldValue字段值，可以返回当前标志的值，例如：如果返回0，则表示图书正常，如果为1，则图书已经下架。
        //bool b = XJX.Page.Book.Shelf_One_Book_From_BID(uid, bid, out ReturnValue, out ReturnFieldValue);
        //if (b){msg.Text = "执行成功！";}else{if (ReturnValue == 9) { msg.Text = "图书未处于正常借阅状态！"; } else { msg.Text = "其它原因执行失败！"; } }


//---------------------------------------------------------------------------------------------------------------------------------------


        return;
    }
    protected void Button2_Click(object sender, EventArgs e)
    {
        int R=XJX.Page.Helper.SendShortMsg("13517400938", "WEB服务短信发送程序测试！");

        int r = R;
    }
    protected void Button3_Click(object sender, EventArgs e)
    {
        //string JUID = "3e537cd3-7d86-417c-a732-dd01fcab6e92";
        //string CUID = "510a49d9-08d8-420b-96d1-fdc909d4db44";
        //string BID = "YS0000003040";

        //XJX.Page.Helper.CallTemplater(1, "ToBorrowTitle", "ToBorrowTemplate", JUID, BID, "", DateTime.Parse(Bdate));//发给借阅人的短信。

        //XJX.Page.Helper.CallTemplater(1, "ToHolderTitle", "ToHolderTemplate", CUID, BID, "12345678901");//发送给图书持有人的短信。

    }
    protected void Button4_Click(object sender, EventArgs e)
    {
        string JUID = "3e537cd3-7d86-417c-a732-dd01fcab6e92";

        DataTable dt = new DataTable();

        dt = XJX.Page.Book.Get_One_Family_Book_From_UID(JUID);

        XJX.Page.Helper.CreateExcel(dt, "application/ms-excel", "Excel" + DateTime.Now.ToString("yyyy-MM-dd_HHmmss"));//调用函数
    }
}